<template>
  <div class="app-container">
    <!-- {{ArrModel}} -->
    <!-- {{QualificationInfo}} -->
    <el-row v-for="(items,index) in this.QualificationInfo" :key="index">
      <el-col :span="24">
        <!-- <h4 v-for="(item,index) in this.QualificationInfo" :key="index">{{index+1}}、{{item.quesTypeName}}</h4> -->
        <h4>{{start+index+1}}、{{items.quesTypeName}}</h4>
      </el-col>
      <el-col>
        <!-- {{ArrModel[index].quesSelId}} -->
        <el-radio-group v-model="ArrModel[index].quesSelId">
          <el-radio
            :label="item.id"
            v-for="item in items.quesSelInfos"
            :key="item.id"
            :disabled="flag"
          >
            <span>{{item.quesSelTypeName}}</span>
            <!-- <span v-if="type!=3"> -->
            <!-- <el-input v-model="ArrModel[index].selDesc" v-if="item.id!=1" style="width:80%" type="text" size="small"></el-input>
            </span>
            <span v-else>-->
            <el-input
              v-model="ArrModel[index].selDescOne"
              v-if="item.id==2"
              maxlength="60"
              style="width:80%"
              type="text"
              size="small"
              :disabled="disFlag"
            ></el-input>
            <el-input
              v-model="ArrModel[index].selDescTwo"
              v-if="item.id==3"
              maxlength="60"
              style="width:80%"
              type="text"
              size="small"
              :disabled="disFlag"
            ></el-input>
            <!-- </span> -->
          </el-radio>
        </el-radio-group>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  // props:{
  //   sunnaryInfo:{
  //     type: Object,
  //     default: {}
  //   }
  // },
  props: {
    examType: {
      type: String,
      default: null
    },
    start: {
      type: Number,
      default: null
    },
    QualificationInfo: {
      type: Array,
      default: () => {
        return [];
      }
    },
    quesSelIds: {
      type: Array,
      default: () => {
        return [];
      }
    },
    type: {
      type: Number,
      default: () => {
        return null;
      }
    },
    number: {
      type: Number,
      default: () => {
        return 0;
      }
    },
    quesTypeName: {
      type: Array,
      default: () => {
        return [];
      }
    }
  },
  data() {
    return {
      flag: true,
      disFlag: true,
      ArrModel: [],
      QuesInfos: [],
      quesTypeNameArr: [],
      Qualification: [],
      QualificationArr: {},
      oldArr: [],
      // examQuesSelInfos:[{examType:"",quesType:"",quesSelId:"",selDesc:" "}],
      form: {
        hospitalName: "",
        hospitalLvl: "",
        branchOfficeName: "",
        appStatus: null,
        examStatus: "",
        examScore: null,
        safetyScore: null,
        envScore: null,
        serviceScore: null,
        reportDesc: null
      },
      appStatusOption: [
        { lable: "上架", value: 0 },
        { lable: "未上架", value: 1 }
      ],
      examStatusOption: [
        { lable: "未严选", value: 0 },
        { lable: "严选通过", value: 1 }
      ]
    };
  },
  created() {
    // console.log(this.sunnaryInfo)
    // this.getFatherInfo()
    console.log(this.examType,this.number,12121212);
    // this.ArrModel.push({examType:this.examType})
    for (let i = 0; i < this.number; i++) {
      this.ArrModel.push({
        quesSelId: "",
        selDescOne: null,
        selDescTwo: null,
        examType: this.examType,
        quesType: this.examType + "_" + (i + 1)
      });
    }
    console.log("this.ArrModel", this.ArrModel);
    // if (this.quesSelIds.length>0) {
    // this.quesSelIds.forEach((item,index) => {

    //   this.ArrModel.push({ radio  : item });
    // });
    // }
    // console.log(this.ArrModel, 123);
    if (this.type != 1) {
      this.flag = false;
      this.disFlag = false;
    }
    // 组件创建完成之后，自定义事件，向父组件传递数据
    // this.$emit("update", this.ArrModel)
  },
  watch: {},
  methods: {
    checkfn() {
      let abc = "";
      this.$refs["number"].validate(valid => {
        console.log(123, valid);

        if (valid) {
          abc = true;
        } else {
          this.$message({
            message: "请完善信息再提交",
            type: "warning"
          });
          abc = false;
        }
      });
      return abc;
    },
    getFatherInfo() {}
  }
};
</script>
<style  scoped>
.el-col-24 {
  width: 100%;
  margin: 10px;
}
</style>